<template>
  <div class="father">
    <h3>父组件</h3>
	<h2>父亲的汽车：{{ car }}</h2>
	<h2 v-show="childToy">孩子给的玩具：{{ childToy }}</h2>
	<Child :car="car" :get-toy="getToy"/>	
  </div>
</template>

<script setup lang="ts" name="Father">
import { ref } from 'vue';
import Child from './Child.vue';
let car=ref("奔驰")
let childToy=ref("")
function getToy(value:string){
	console.log("在父组件中触发该方法：：getToy",value)
	childToy.value=value


}
	
</script>

<style scoped>
	.father{
		background-color:rgb(165, 164, 164);
		padding: 20px;
		border-radius: 10px;
	}
</style>